export const to = (url, switchTab) => {
	if (!url) return
	if (switchTab) {
		uni.switchTab({
			url
		})
	} else {
		uni.navigateTo({
			url
		})
	}
}

export const prePage = (num = 2) => {
	let pages = getCurrentPages();
	console.log(num);
	let prePage = pages[pages.length - num];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}